import java.util.LinkedList;


public class NotGate extends BasicGate {

	public boolean calculateValue() {
		LinkedList<Gate> inputs = (LinkedList<Gate>)getInputGates();
		
		return !inputs.getFirst().getOutputValue();	
	}
	
	public void setInputGate(Gate g) {
		if(this.getInputGates().size() == 0) 
			super.setInputGate(g);
		else
			throw new GateException("Only one gate allowed as input on a not-gate!");
	}
	
}
